<script setup lang="ts">
import {onLaunch, onLoad} from '@dcloudio/uni-app'
import { getToken } from "@/utils/userInfo";
import {checkLoginBeforeEnter} from "@/utils/loginStop";
onLaunch(() => {

  // 添加全局路由拦截器
  uni.addInterceptor('navigateTo', {
    invoke(e) {
      return checkLoginBeforeEnter(e.url)
    }
  })

  uni.addInterceptor('redirectTo', {
    invoke(e) {
      return checkLoginBeforeEnter(e.url)
    }
  })

  uni.addInterceptor('switchTab', {
    invoke(e) {
      return checkLoginBeforeEnter(e.url)
    }
  })
})
onLoad(() => {

    console.log('页面加载完成')
  })
</script>

<style lang="scss">
  /* 引入图鸟UI样式 */
  @import '@tuniao/tn-style/dist/uniapp/index.css';
  @import '@tuniao/tn-icon/dist/index.css';
  /* 全局样式 */
  @import '@/assets/css/base.css';
  @import '@/assets/css/main.css';
  @import '@/assets/css/icon.css';
  @import '@/assets/css/animation.css';
  /* 在页面样式中添加 */
  ::-webkit-scrollbar {
    display: none; /* 隐藏滚动条 */
    width: 0;
    height: 0;
  }

  /* 兼容 H5 端 */
  .scroll-view ::-webkit-scrollbar {
    display: none;
  }

  scroll-view::-webkit-scrollbar {
    display: none;
  }
</style>
